import { createContext } from 'react';

export const context = createContext({});

export const tableConfig = [
  {
    id: 1,
    title: '需求收集邮件',
    week: '周五',
    date: '3.3',
    reqName: '生产准备需求&沟通',
    reqList: ['生产准备需求&沟通', 'xxx'],
    group: 1,
  },
  {
    id: 11,
    title: null,
    week: '周五',
    date: '3.3',
    reqName: 'xxx',
    reqList: ['生产准备需求&沟通', 'xxx'],
    group: 1,
  },

  {
    id: 2,
    title: null,
    week: '周一',
    date: '3.6',
    reqName: '生产准备需求&沟通',
    reqList: ['生产准备需求&沟通', 'xxx'],
    group: 1,
  },
  {
    id: 3,
    title: null,
    week: '周二',
    date: '3.7',
    reqName: '生产准备需求&沟通',
    reqList: ['生产准备需求&沟通', 'xxx'],
    group: 1,
  },
  {
    id: 4,
    title: '生产串讲&需求确认',
    week: '周三',
    date: '3.8',
    reqName: '生产准备需求&沟通',
    reqList: ['生产准备需求&沟通'],
    group: 1,
  },

  {
    id: 5,
    title: null,
    week: '周四',
    date: '3.9',
    reqName: '需求细化5天',
    reqList: ['需求细化5天'],
    group: 2,
  },
];

export const tableConfig2 = [
  {
    id: 1,
    sprintName: 'V8.6.0',
    index: 1,
    stageList: [
      {
        id: 11,
        title: '生产准备需求&沟通',
        color: '#DDEAD5',
        duration: 4,
        dateList: [
          {
            date: '3.3',
            week: '周五',
            isHoliday: false,
            isWorkday: true,
            eventList: [
              {
                id: 101,
                eventName: '需求收集邮件',
              },
            ],
          },
          {
            date: '3.4',
            week: '周六',
            isHoliday: true,
            isWorkday: false,
          },
          {
            date: '3.5',
            week: '周日',
            isHoliday: true,
            isWorkday: false,
          },
          {
            date: '3.6',
            week: '周一',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.7',
            week: '周二',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.8',
            week: '周三',
            isHoliday: false,
            isWorkday: true,
            eventList: [
              {
                id: 102,
                eventName: '生产串讲&需求确认',
              },
            ],
          },
        ],
      },
      {
        id: 12,
        title: '需求细化',
        color: '#BDD5AC',
        duration: 5,
        dateList: [
          {
            date: '3.9',
            week: '周四',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.10',
            week: '周五',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.11',
            week: '周六',
            isHoliday: true,
            isWorkday: false,
          },
          {
            date: '3.12',
            week: '周日',
            isHoliday: true,
            isWorkday: false,
          },
          {
            date: '3.13',
            week: '周一',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.14',
            week: '周二',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.15',
            week: '周三',
            isHoliday: false,
            isWorkday: true,
            eventList: [
              {
                id: 103,
                eventName: '产品内审',
              },
            ],
          },
        ],
      },
      {
        id: 13,
        title: '需求预串+串讲',
        color: '#A2C689',
        duration: 3,
        dateList: [
          {
            date: '3.16',
            week: '周四',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.17',
            week: '周五',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.18',
            week: '周六',
            isHoliday: true,
            isWorkday: false,
          },
          {
            date: '3.19',
            week: '周日',
            isHoliday: true,
            isWorkday: false,
          },
          {
            date: '3.20',
            week: '周一',
            isHoliday: false,
            isWorkday: true,
            eventList: [
              {
                id: 104,
                eventName: '封板',
                needEventColor: '#02A74D',
              },
            ],
          },
        ],
      },
      {
        id: 14,
        title: '开发',
        color: '#2E6FAB',
        duration: 6,
        dateList: [
          {
            date: '3.21',
            week: '周二',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.22',
            week: '周三',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.23',
            week: '周四',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.24',
            week: '周五',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.25',
            week: '周六',
            isHoliday: true,
            isWorkday: false,
          },
          {
            date: '3.26',
            week: '周日',
            isHoliday: true,
            isWorkday: false,
          },
          {
            date: '3.27',
            week: '周一',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.28',
            week: '周二',
            isHoliday: false,
            isWorkday: true,
          },
        ],
      },
      {
        id: 15,
        title: '测试',
        color: '#95BADC',
        duration: 4,
        dateList: [
          {
            date: '3.29',
            week: '周三',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.30',
            week: '周四',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.31',
            week: '周五',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '4.1',
            week: '周六',
            isHoliday: true,
            isWorkday: false,
          },
          {
            date: '4.2',
            week: '周日',
            isHoliday: true,
            isWorkday: false,
          },
          {
            date: '4.3',
            week: '周一',
            isHoliday: false,
            isWorkday: true,
          },
        ],
      },
      {
        id: 16,
        title: '灰度验收',
        color: '#F30404',
        duration: 1,
        dateList: [
          {
            date: '4.4',
            week: '周三',
            isHoliday: false,
            isWorkday: true,
            eventList: [
              {
                id: 105,
                eventName: '正式发布',
                needEventColor: '#D9001B',
              },
            ],
          },
        ],
      },
    ],
  },
  {
    id: 2,
    sprintName: 'V8.5.9',
    index: 2,
    stageList: [
      {
        id: 14,
        title: '开发',
        color: '#2E6FAB',
        duration: 3,
        dateList: [
          {
            date: '3.21',
            week: '周二',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.22',
            week: '周三',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.23',
            week: '周四',
            isHoliday: false,
            isWorkday: true,
          },
        ],
      },
      {
        id: 15,
        title: '测试',
        color: '#95BADC',
        duration: 2,
        dateList: [
          {
            date: '3.24',
            week: '周五',
            isHoliday: false,
            isWorkday: true,
          },
          {
            date: '3.25',
            week: '周六',
            isHoliday: true,
            isWorkday: false,
          },
          {
            date: '3.26',
            week: '周日',
            isHoliday: true,
            isWorkday: false,
          },
          {
            date: '3.27',
            week: '周一',
            isHoliday: false,
            isWorkday: true,
          },
        ],
      },
      {
        id: 16,
        title: '灰度验收',
        color: '#F30404',
        duration: 1,
        dateList: [
          {
            date: '3.28',
            week: '周二',
            isHoliday: false,
            isWorkday: true,
            eventList: [
              {
                id: 105,
                eventName: '正式发布',
                needEventColor: '#D9001B',
              },
            ],
          },
        ],
      },
    ],
  },
];

function testUseState() {
  let value = null;
  function setValue(v) {
    value = v;
  }
  return function (defaultValue) {
    if (!value) {
      value = defaultValue;
    }
    return [value, setValue];
  };
}
export const myUseState = testUseState();
